﻿<label class="switch">
    <input type="checkbox" checked="@IsEnabled" @onchange="Change">
    <span class="slider round"></span>
</label>

@code
{
    [Parameter]
    public bool IsEnabled { get; set; }

    [Parameter]
    public Action<bool> OnChange { get; set; }

    private void Change(ChangeEventArgs e)
    {
        var newValue = (bool)e.Value;
        IsEnabled = newValue;
        OnChange(newValue);
    }
}